﻿﻿{extends file="layout.tpl"}
{block name="title"}Register{/block}
{block name="script"}
        $(document).ready(function () {
            setupTinyMCE();
            setupProgressbar('progress-bar');
            setDatePicker('date-picker');
            setupDialogBox('dialog', 'opener');
            $('input[type="checkbox"]').fancybutton();
            $('input[type="radio"]').fancybutton();
		
            $( "#frmDangKy" ).validate({
				rules: {
					email:{
						required: true,
						email: true
					},
					pwd: {
						minlength:5,
						required: true
					},
					repwd: {
							equalTo: "#pwd"
							
					},
					hoten:{
						required: true,
						maxlength: 45
					},
					captcha:{
						required: true
					}
				},
				messages: {
				
					email:{
						required: "Xin mời nhập email",
						email: "Email không đúng định dạng"
					},
					pwd: {
						minlength:"Mật khẩu phải có ít nhất 5 ký tự",
						required: "Xin mời nhập mật khẩu"
					},
					repwd: {
							equalTo: "Mật khẩu không khớp"
							
					},
					hoten:{
						required: "Xin mời nhập họ và tên",
						maxlength: "Độ dài tối đa là 45 ký tự"
					}
				}
			});
			
        });
{/block}
{block name="content"}
            
        
        <div class="grid_12">
            <div class="box round first center" style="width:50%;">
                <h2>
                    Đăng ký tài khoản</h2>
                <div class="block ">
                    <div class="message error" style="display:{$is_display_error|default:'none'};">{$error_message|default:''}
					{validate id="email_required" message="##EM_EMAIL_IS_REQUIRED##<br>"}
					{validate id="email_valid" message="##EM_EMAIL_INCORRECT_FORMAT##<br>"}
					{validate id="password_required" message="##EM_PASSWORD_IS_REQUIRED##<br>"}
					{validate id="password_valid" message="##EM_PASSWORD_IS_REQUIRED##<br>"}
					{validate id="confirm_password" message="##EM_CONFIRM_PASSWORD##<br>"}
					{validate id="fullname_required" message="##EM_FULLNAME_IS_REQUIRED##<br>"}
					{validate id="fullname_maxlength" message="##EM_FULLNAME_IS_REQUIRED##<br>"}
					{validate id="captcha_valid" message="##EM_CAPTCHA_VALID##<br>"}</div>	
					<form id="frmDangKy" action="register.php" method="post">
                    <table class="form">
                        <tr>
                            <td class="col1">
                                <label>
                                    ##LB_EMAIL## : </label>
                            </td>
                            <td class="col2">
                                <input type="text" name="email" type="email" id="email" class="medium" value="{$email|default:''}"/>
                             
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                   ##LB_PASSWORD##</label>
                            </td>
                            <td>
                                <input type="password" class="medium" id="pwd" name="pwd"/>
                               
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    ##LB_CONFIRM_PASSWORD##</label>
                            </td>
                            <td>
                              <input type="password" class="medium" id="repwd" name="repwd"/>
                              
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    ##LB_FULLNAME##</label>
                            </td>
                            <td>
                                <input type="text" class="medium" id="hoten" name="hoten" value="{$hoten|default:''}"/>
                               
                            </td>
                        </tr>
                      	<tr>
                      	<tr>
                      	<td><img src="libs/captchar/captcha.php" id="captcha" /><br/>
								<!-- CHANGE TEXT LINK -->
									<a href="#" onclick="
    					document.getElementById('captcha').src='libs/captchar/captcha.php?'+Math.random();
    					document.getElementById('captcha-form').focus();"
    					id="change-image">##LB_CHANGE_CAPTCHA##</a><br/><br/>
                      	</td>
                      	<td>
                      	 <input type="text" class="medium" id="captcha" name="captcha" />
                      	</td>
                      	</tr>
                      	<td colspan="2" align="center">
                      		
    						
                      	<input type="submit" name='submit' class="btn-blue" value="##LB_REGISTER##"/>
                      	
                      	</td>
                      	</tr>
                    </table>
                    </form>
                </div>
            </div>
        </div>
                                {/block}
